package biz.ezcom.spring.datasource.bean;

import java.util.Date;

public class Person {
	private int id;
	private String username;
	private String password;
	private int age;
	private Date registerDate;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public Date getRegisterDate() {
		return registerDate;
	}
	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj.getClass() != Person.class){
			return false;
		}
		Person target = (Person)obj;
		if(target.getId() != id){
			return false;
		}
		if(!target.getUsername().equals(username)){
			return false;
		}
		if(!target.getPassword().equals(password)){
			return false;
		}
		if(target.getAge() != age){
			return false;
		}
		return true;
	}
	
}
